package com.example.phonestore.controller;

import com.example.phonestore.entity.City;
import com.example.phonestore.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("city")
public class CityController {
    @Autowired
    private CityService cityService;
    @RequestMapping({"/",""})
    public List<City> getCity(String parent){
        List<City> data=cityService.getByParent(parent);
        return data;
    }
}
